package switchviz.core.mib;
import org.jdom.Element;

import switchviz.gui.component.IXMLFilter;

public class MIBXMLFilter extends IXMLFilter
{
	public MIBXMLFilter() 
	{
		this.ignoreName(MIBTree.MIBNODEDESCRIPTION);
		this.ignoreName(MIBTree.MIBNODETYPE);
		this.ignoreName(MIBTree.MIBNODERANGE);
		this.ignoreName(MIBTree.MIBNODEPORT);
	}
	
	public String Extract(Element rawNode)
	{
		if (MIBTree.MIBNODE.equals(rawNode.getName()))
			return rawNode.getAttributeValue(MIBTree.MIBNODENAME) + " :: " + rawNode.getAttributeValue(MIBTree.MIBNODEOID);
		
		return rawNode.getName();
	}
}
